import * as React from 'react';
import {observer} from 'mobx-react'
import styles from './index.scss';
import WaterFlow from "./waterFlow"
import WaterFix from "./waterFix"
interface IProps {
    WaterType: Boolean
    title?: string// 标题
    chartData1:any
    chartData2:any
    legend1?: string[]
    legend2?: string[]
}


@observer
class Home extends React.Component<IProps> {

    constructor(props) {
        super(props);
    }


    public render() {
        const {title, WaterType, legend1,legend2,chartData1,chartData2} = this.props
        return (
            <div className={styles.scatter}>
                <div className={styles.title}>{title}</div>
                <div className={styles.EChart}>
                    {
                        WaterType?<WaterFix chartData={chartData1} legend={legend1} ></WaterFix>
                        :<WaterFlow chartData={chartData2} legend={legend2}></WaterFlow>
                    }
                </div>
            </div>
        );
    }
}

export default Home;
